package com.aysafety.eventmodel.dao;

import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @program: iotDataPlatform
 * @description: 微震
 * @author: ChengQi
 * @create: 2019-01-26 17:30
 **/
@Mapper
@Repository
public interface MicroseismDao {

    /** 
    * @Description: 查询实时数据
    * @Param: [params] 
    * @return: int 
    * @Author: ChengQi 
    * @Date: 2019/1/26 
    */ 
    public List<Map<String,Object>> queryRealMicroseism(Map<String, Object> params);

    /** 
    * @Description: 微震实时数量
    * @Param: [parram] 
    * @return: long 
    * @Author: ChengQi 
    * @Date: 2019/1/29 
    */ 
    long countRealMicroseism(Map<String, Object> parram);

    /** 
    * @Description: 频次、频次偏差、日总
    * @Param: [map] 
    * @return: void 
    * @Author: ChengQi 
    * @Date: 2019/2/15 
    */ 
    void saveFrequency(Map<String, Object> map);

    /**
    * @Description: 查询大能量事件
    * @Param: [parram]
    * @return: java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
    * @Author: ChengQi
    * @Date: 2019/3/7
    */
    List<Map<String, Object>> queryLarge(Map<String, Object> parram);

    /** 
    * @Description: 两次大能量矿震事件之间发生的频次
    * @Param: [parram] 
    * @return: java.util.List<java.util.Map<java.lang.String,java.lang.Object>> 
    * @Author: ChengQi 
    * @Date: 2019/3/7 
    */
    int countBetweenLarge(Map<String, Object> parram);

    /**
    * @Description: 查询系统参数
    * @Param: [parram]
    * @return: java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
    * @Author: ChengQi
    * @Date: 2019/3/7
    */
    Map<String, Object> querySys(Map<String, Object> parram);

    /**
    * @Description: 能量平均值
    * @Param: [parram]
    * @return: double
    * @Author: ChengQi
    * @Date: 2019/3/8
    */
    double avgBetweenLarge(Map<String, Object> parram);

    /** 
    * @Description: 能量偏差值 、频次比
    * @Param: [resultMap] 
    * @return: void 
    * @Author: ChengQi 
    * @Date: 2019/3/8 
    */ 
    void saveCalfrequencyRatioAndEnergyDeviation(Map<String, Object> resultMap);

    /**
    * @Description: 根据能量大小排序
    * @Param: [parram]
    * @return: java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
    * @Author: ChengQi
    * @Date: 2019/3/8
    */
    List<Map<String, Object>> queryRealMicroseismByEmergoa(Map<String, Object> parram);

    /** 
    * @Description: 离散度
    * @Param: [resultMap] 
    * @return: void 
    * @Author: ChengQi 
    * @Date: 2019/3/11 
    */ 
    void saveDispersion(Map<String, Object> resultMap);

    /** 
    * @Description: 查询频次比
    * @Param: [parram] 
    * @return: java.util.List<java.lang.Double> 
    * @Author: ChengQi 
    * @Date: 2019/3/18 
    */ 
    List<Map<String, Object>> queryEnergyDeviation1(Map<String, Object> parram);

    /**
    * @Description: 查询离散度
    * @Param: [parram]
    * @return: java.util.List<java.lang.Double>
    * @Author: ChengQi
    * @Date: 2019/3/18
    */
    List<Map<String, Object>> queryDispersion1(Map<String, Object> parram);

    /** 
    * @Description: 查询学习出来的临界值
    * @Param: [parram] 
    * @return: java.util.Map<java.lang.String,java.lang.Object> 
    * @Author: ChengQi 
    * @Date: 2019/3/18 
    */ 
    Map<String, Object> queryMicroseismWarningStudy(Map<String, Object> parram);


    /**
     * 查询预警程度W值
     * @param params
     * @return
     */
    List<Double> queryMircroseismWarning(Map<String, Object> params);

    /** 
    * @Description: 计算综合预警
    * @Param: [resultMap] 
    * @return: void 
    * @Author: ChengQi 
    * @Date: 2019/3/18 
    */ 
    void saveWarning(Map<String, Object> resultMap);
}
